// paing dung cho viewscope bean thoai nguyen
function pagginNew() {
	start = $('#start').val();
	end = $('#end').val();
	var link = $(location).attr('href');
	var pl;
	var pos = link.indexOf('p=');
	if (pos != -1) {
		link = link.substring(0, pos - 1);

	}
	if (link.indexOf('?') != -1)
		pl = '&p=';
	else
		pl = '?p=';
	current = $('#current').val();
	total = $('#page').val();
	$('.page-element').html('');
	$('.page-element').append(
			'<a href="' + link + pl + 1 + '">' + "<<" + ' </a>');
	if (current > 1) {
		$('.page-element').append(
				'<a href="' + link + pl + (current - 1) + '">' + "<" + ' </a>');
	}

	while (parseInt(start) <= parseInt(end)) {
		style = "";
		if (parseInt(start) == parseInt(current)) {
			style = "selected_page";
		}
		$('.page-element').append(
				'<a class="' + style + '" href="' + link + pl + start + '">'
						+ start + ' </a>');
		start++;
	}

	if (parseInt(current) < parseInt(total)) {
		$('.page-element').append(
				'<a href="' + link + pl + (parseInt(current) + 1) + '">' + '>'
						+ ' </a>');
	}
	if (total > 0) {
		$('.page-element').append(
				'<a href="' + link + pl + total + '">' + ">>" + ' </a>');
	} else {
		$('.page-element').append(
				'<a href="' + link + pl + (parseInt(total) + 1) + '">' + ">>"
						+ ' </a>');
	}
}
function paggin() {


	start = $('#start').val();
	end = $('#end').val();
	var link = $(location).attr('href');
	var pl;
	var pos = link.indexOf('p=');
	if (pos != -1) {
		link = link.substring(0, pos - 1);

	}
	if (link.indexOf('?') != -1)
		pl = '&p=';
	else
		pl = '?p=';
	current = $('#current').val();
	total = $('#page').val();
	$('.page-element').html('');
	$('.page-element').append(
			'<label class="total">Tổng số</label> <font style="color:red">' + $('#row').val() + '</font>  ');
	$('.page-element').append(
			'<a class="pre" href="' + link + pl + 1 + '">' + "<<" + ' </a>');
	if (current > 1) {
		$('.page-element').append(
				'<a class="pre-1" href="' + link + pl + (current - 1) + '">' + "<" + ' </a>');
	}

	while (parseInt(start) <= parseInt(end)) {
		style = "";
		if (parseInt(start) == parseInt(current)) {
			style = "black";
		}
		$('.page-element').append(
				'<a class="' + style + '" href="' + link + pl + start + '">'
						+ start + ' </a>');
		start++;
	}

	if (parseInt(current) < parseInt(total)) {
		$('.page-element').append(
				'<a class="next-1" href="' + link + pl + (parseInt(current) + 1) + '">' + '>'
						+ ' </a>');
	}
	if (total > 0) {
		$('.page-element').append(
				'<a class="next" href="' + link + pl + total + '">' + ">>" + ' </a>');
	} else {
		$('.page-element').append(
				'<a class="next" href="' + link + pl + (parseInt(total) + 1) + '">' + ">>"
						+ ' </a>');
	}

}